//
//  ZYXClassNameModel.m
//  RuiBeiKang
//
//  Created by iOS开发1 on 2019/1/8.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXClassNameModel.h"

@implementation ZYXClassNameModel
-(instancetype)initWitTitle:(NSString *)title andNSArry:(NSArray *)arr isMore:(BOOL)isTop{
    if (self = [super init]) {
        self.titleStr = title;
        self.dataArr = arr;
        self.isTop = isTop;
    }
    return self;
}
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{
             @"uid" : @[@"id"]
             };
}

+ (NSDictionary *)mj_objectClassInArray{
    return @{ @"res":@"ZYXClassNameDerailModel"};
}
@end

@implementation ZYXClassNameDerailModel
- (instancetype)initWithDict:(NSDictionary *)dict {
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}
- (instancetype)initWitTitle:(NSString *)title andVideo_url:(NSString *)video_url andVid:(NSString *)vid isSelect:(BOOL)isSelect{
    if (self = [super init]) {
//        self.title = title;
//        self.video_url = video_url;
//        self.vid = vid;
//        if ([self.video_type isEqualToString:@"1"]) {
//             self.file_type = @"mp4";
//        }else{
//            self.file_type = @"mp3";
//        }
//
//        self.isSelect = isSelect;

    }
    return self;
}
+ (NSData *)dateWithInfoModel:(ZYXClassNameDerailModel *)mo {
    NSDictionary *dict = [mo dictionaryWithValuesForKeys:[mo getAllKeys]];
    return [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil];
}
- (NSArray *)getAllKeys{
    unsigned int count = 0;
    objc_property_t *properties = class_copyPropertyList(self.class, &count);
    NSMutableArray *keys = [NSMutableArray array];
    for (int i=0; i<count; i++) {
        objc_property_t property = properties[i];
        const char *name = property_getName(property);
        [keys addObject:[NSString stringWithUTF8String:name]];
    }
    return keys;
}
+ (ZYXClassNameDerailModel *)infoWithData:(NSData *)data {
    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
    ZYXClassNameDerailModel *mo = [[ZYXClassNameDerailModel alloc] initWithDict:dict];
    return mo;
}
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{
             @"uid" : @[@"id"],
             
             };
}

+ (NSDictionary *)mj_objectClassInArray{
    return @{};
}
@end
@implementation ZYXClassModel

@end
